package net.roobook.server.test;

import net.roobook.common.annotation.EnableRoobookAuthExceptionHandler;
import net.roobook.common.annotation.EnableRoobookOauth2FeignClient;
import net.roobook.common.annotation.EnableRoobookServerProtect;
import net.roobook.common.annotation.RoobookCloudApplication;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @Author Roobook
 * @description 测试微服务
 * @date 2022/4/8
 */
@EnableFeignClients // 注解标注，开启Feign Client功能
@EnableDiscoveryClient  // 开启服务注册与发现
@SpringBootApplication
@EnableGlobalMethodSecurity(prePostEnabled = true)  // 开启Spring Cloud Security权限注解
// @EnableRoobookAuthExceptionHandler  //Enable注解实现资源服务器异常处理，认证类型异常翻译
// @EnableRoobookOauth2FeignClient     // 开启带令牌的Feign请求，避免微服务内部调用出现401异常
// @EnableRoobookServerProtect // 开启微服务防护，避免客户端绕过网关直接请求微服务
@RoobookCloudApplication
@MapperScan("net.roobook.server.test.mapper")
@EnableTransactionManagement
public class RoobookServerTestApplication {

    public static void main(String[] args) {
        SpringApplication.run(RoobookServerTestApplication.class, args);
    }
}
